package g06;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JTextArea;




public class NameDragDrop extends JFrame implements ActionListener{
	
	
	/**@author Matt Kussy
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final int FRAME_X = 550;
	private final int FRAME_Y = 100;
	private final int FRAME_WIDTH = 565;
	private final int FRAME_HEIGHT = 500;
	private JTextArea text1;
	private JTextArea text2;
	private final int TEXT1_X = 10, TEXT1_Y=30, TEXT1_WIDTH=260, TEXT1_HEIGHT=400;
	private final int TEXT2_X = 280, TEXT2_Y=30, TEXT2_WIDTH=260, TEXT2_HEIGHT=400;
	private JMenuBar menuBar;
	private JMenu menu;
	private JMenuItem openMenu, saveMenu, newMenu;
	
	
	
	/** This is to Create a Box with two text fields. I couldn't get the drag and drop
	 * to work but my plan was to make the user able to move names from one side
	 * to the other and then save and open the list.
	 * 
	 * 
	 */
	public NameDragDrop(String title){
		//create gui
		setLayout(null);
		setBounds(FRAME_X, FRAME_Y, FRAME_WIDTH, FRAME_HEIGHT);
		setBackground(Color.GRAY);
		
		 
		
		
		//create two text areas
		text1 = new JTextArea();
		text1.setBorder( BorderFactory.createLoweredBevelBorder() );
		text1.setBounds( TEXT1_X, TEXT1_Y, TEXT1_WIDTH, TEXT1_HEIGHT );
		text1.setLineWrap( true );
		text1.setText("Joe Webb \nBlake Griffin \nPayton Manning \nKevin Durrant \nArian Foster \nRoy Helu \nGarrett Lucking \nRoyce White \nCam Newton ");
	
	
		add( text1 );
		
		text2 = new JTextArea();
		text2.setBorder( BorderFactory.createLoweredBevelBorder() );
		text2.setBounds( TEXT2_X, TEXT2_Y, TEXT2_WIDTH, TEXT2_HEIGHT );
		text2.setLineWrap( true );
		add( text2 );
		
		
		//creates menu bar 
		menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		menu = new JMenu("File");
		menuBar.add(menu);
		
		newMenu = new JMenuItem("New");
		newMenu.addActionListener(this);
		menu.add(newMenu);

		openMenu = new JMenuItem("Open");
		openMenu.addActionListener(this);
		menu.add(openMenu);

		saveMenu = new JMenuItem("Save");
		saveMenu.addActionListener(this);
		menu.add(saveMenu);
		
		setTitle(title);
		setVisible( true );
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}

	
	public static void main(String[] args) {
		
	

		//runs the JFrame
		new NameDragDrop("Drag and Drop");

	}


	@Override
	public void actionPerformed(ActionEvent arg0) {
	
		
	}

	
}
